package com.party.core.dao.read.article;

import com.party.common.annotation.DataAuthParam;
import com.party.common.paging.Page;
import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.article.Article;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 文章数据读取 party Created by wei.li on 2016/9/20 0020.
 */
@Repository
public interface ArticleReadDao extends BaseReadDao<Article> {

	/**
	 * 根据频道获取文章
	 *
	 * @param id
	 * @return
	 */
	List<Article> getByChannelId(String id);

	/**
	 * web端
	 *
	 * @param article
	 * @param params
	 * @param page
	 * @return
	 */
	List<Article> webListPage(@Param(value = "article") Article article, @Param(value = "params") Map<String, Object> params, Page page);

    /**
     * 服务指南文章
     *
     * @param memberId 用户id
     * @param page     分页
     * @return
     */
    List<Article> getServiceList(@Param(value = "memberId") String memberId, Page page);

	Map<String, Object> countAnalyzeByDate(@Param("startDate") String startDate,
										   @Param("endDate") String endDate,
										   @Param("params") Map<String, Object> params);

	List<Article> getServiceListByGuideId(@Param(value = "memberId") String memberId,
										  @Param("sgtId")String sgtId,
										  Page page);

	List<Article> queryArticleList(@Param(value = "params") Map<String, Object> params, Page page);
	
	/** 
	* @Description: web素材分页查询
	* @Param:  
	* @return:  
	* @Author: Hua Qunhao
	* @Date: 2019/12/12 
	*/
	@DataAuthParam(moduleType="MEMBERMGMT" ,field="member_group_user_id",alias="cn")
	List<Article> webMaterialListPage(@Param(value = "article") Article article, @Param(value = "params") Map<String, Object> params, Page page);
}
